package com.education.service.trade.feign.fallback;

import com.education.result.R;
import com.education.service.trade.feign.EduCourseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 远程调用 - 熔断保护
 * Created by Lance on 2020/07/09 16:48
 */
@Slf4j
@Service
public class EduCourseServiceFallBack implements EduCourseService {
    /**
     * 根据课程ID查询课程信息 - [ 远程调用 ]
     * @param courseId
     * @return
     */
    @Override
    public R getCourseDtoById(String courseId) {
        log.warn("熔断保护");
        return R.error();
    }

    /**
     * 根据课程id更改销售量
     * @param id
     * @return
     */
    @Override
    public R updateBuyCountById(String id) {
        log.warn("熔断器被执行");
        return R.error();
    }
}
